
# mysql数据库连接测试使用pychare

import pymysql
conn = pymysql.connect(host='localhost',user = 'root',password= "root",database = 'wangxiaofei')
cursor = conn.cursor() # 创建运行语句
cursor.execute("INSERT INTO admin (user,password,text) VALUES ('root1','root1','0')" )
cursor.execute("select * from admin")
ss=cursor.fetchall();#生成列表
for s in ss:
    print(s)
    print("\t")

cursor.close()
